package com.springboot.controller;

import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Description
 * @Author 顾志杰
 * @Date 2021/11/3 10:57
 */
@org.springframework.stereotype.Controller
public class Controller {

    @GetMapping("toHello")
    public String toHello(HttpServletRequest request, HttpServletResponse response){
        Cookie cookie = new Cookie("name", "hello");
        response.addCookie(cookie);
        return "redirect:http://localhost:20002/hello";
    }
}
